package com.zlx.store.domain.entity.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zlx.store.domain.entity.Goods;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("order_relate_goods_tab")
public class OrderRelateGoodsDTO {

    /**
     * 代理id
     */
    @TableId("id")
    private Long id;


    /**
     * 商品id
     */
    @TableField("goods_id")
    private Long goodsId;


    /**
     * 订单id
     */
    @TableField("order_id")
    private Long orderId;


    /**
     * 门店id
     */
    @TableField("store_id")
    private Long storeId;


    /**
     * 商品价格
     */
    @TableField("goods_price")
    private Double goodsPrice;


    /**
     * 商品名字
     */
    @TableField("goods_name")
    private String goodsName;


    /**
     * 商品封面地址
     */
    @TableField("goods_pic")
    private String goodsPic;


    /**
     * 购买的商品数量
     */
    @TableField("goods_count")
    private Integer goodsCount;

    public OrderRelateGoodsDTO build(Goods goods) {
        this.goodsId = goods.getGoodsId();
        this.goodsName = goods.getGoodsName();
        this.goodsPic = goods.getGoodsPic();
        this.goodsPrice = goods.getGoodsPrice();
        return this;
    }
}



